package com.kob.backend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kob.backend.pojo.product;
import com.kob.backend.pojo.shopcart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ShopcartsMapper extends BaseMapper<shopcart> {
    @Select("select product.* from product,shopcart where product.id=shopcart.productid and shopcart.userid=#{userid}")
    List<product> getshopcarts(@Param("userid")Integer userid);
    @Select("delete from shopcart where userid=#{userid} and productid=#{productid}")
    void deleteshocarts(@Param("userid")Integer userid,@Param("productid")Integer productid);
}
